package com.netease.nie.service;

import java.util.Collections;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.netease.nie.dao.BannerDao;
import com.netease.nie.model.Banner;

/**
 * 
 * @author wwbn3695
 * @createDate July 2rd,2016
 * 
 */
@Service
public class BannerServiceImpl implements BannerService {

	@Autowired
	private BannerDao bannerDao;

	public List<Banner> queryAllNoCustomBannerByPosition(int position) {
		List<Banner> bannerList = bannerDao
				.queryAllNoCustomBannerByPosition(position);
		if (bannerList != null && !bannerList.isEmpty())
			return bannerList;
		return Collections.emptyList();
	}

	public List<Banner> queryAllBannerByPosition(int position) {
		List<Banner> bannerList = bannerDao.queryAllBannerByPosition(position);
		if (bannerList != null && !bannerList.isEmpty())
			return bannerList;
		return Collections.emptyList();
	}
}
